<link rel="stylesheet" href="/assets/css/jquery-ui.css" />
<script src="/assets/js/jquery-1.9.1.js"></script>
<script src="/assets/js/jquery-ui.js"></script>
<script>
    $(function() {
        $( "#datepicker" ).datepicker({dateFormat: "yy-mm-dd"});
    });
</script>
<td>
<div class="textos">
    <table style="width: 400px;" align="center">
        <tr>
            <td>
                
                <form method="post" enctype="multipart/form-data">
                    Fecha: <input type="text" id="datepicker" name="fecha"><br>
                    Título: <input type="text" name="titulo"><br>
                    Resumen: <textarea name="resumen" rows="7" cols="50"></textarea><br>
                    <?php if($seccion == 'market-news') { ?>
                    PDF: <input type="file" name="pdf" accept="application/pdf"><br>
                    <?php } ?>
                    <?php if($seccion == 'knightsbridge-watch') { ?>
                    Parrafo: <textarea name="parrafo" rows="7" cols="50"></textarea><br>
                    <?php } ?>
                    
                    <input type="submit" value="ADD">
                </form>

                <br><br>
                <table border="1">
                    <tr>
                        <th>Fecha</th>
                        <th>Título</th>
                        <th>Resumen</th>
                        <?php if($seccion == 'market-news') { ?>
                        <th>PDF</th>
                        <?php } ?>
                        <?php if($seccion == 'knightsbridge-watch') { ?>
                        <th>Párrafo</th>
                        <?php } ?>
                        <td></td>
                    </tr>
                <?php foreach($news as $new) { ?>
                    <tr>
                        <td><?=$new['fecha']?></td>
                        <td><?=$new['titulo']?></td>
                        <td><?=$new['resumen']?></td>
                        <?php if($seccion == 'market-news') { ?>
                        <td><a href="/upload/<?=$new['pdf']?>" target="_blank">View</a></td>
                        <?php } ?>
                        <?php if($seccion == 'knightsbridge-watch') { ?>
                        <td><?=$new['parrafo']?></td>
                        <?php } ?>
                        <td><a href="/panel/delete/news/<?=$new['idnews']?>/">Delete</a></td>
                    </tr>
                <?php } ?>
                </table>
            </td>
        </tr>
    </table>
</div>
</td>
</tr>
</table>